function success(msg,callback){
	uni.showModal({
	    title: '成功',
	    content: msg,
		showCancel:false,
	    success: function (res) {
	        if (res.confirm) {
	           if(callback){
					callback()
			   }
	        }
	    }
	});
}

function info(msg,callback){
	uni.showModal({
	    title: '信息',
	    content: msg,
		showCancel:false,
	    success: function (res) {
	        if (res.confirm) {
	           if(callback){
					callback()
			   }
	        }
	    }
	});
}

function warn(msg,callback){
	uni.showModal({
	    title: '注意',
	    content: msg,
		showCancel:false,
	    success: function (res) {
	        if (res.confirm) {
	           if(callback){
					callback()
			   }
	        }
	    },
		fail() {
			if(callback){
				callback()
			}
		}
	});
}

function error(msg,callback,title){
	uni.showModal({
	    title: title?title:'错误',
	    content: msg,
		showCancel:false,
	    success: function (res) {
	        if (res.confirm) {
	           if(callback){
	        		callback()
	           }
	        }
	    }
	});
}

function choose(msg,confirm,data,config){
	if(!config){
		config={}
	}
	uni.showModal({
		title: '提醒',
		content: msg,
		cancelText: '取消',
		confirmText: '确定',
		confirmColor:config.confirmColor?config.confirmColor:'red',
		cancelColor:config.cancelColor?config.cancelColor:'#000000',
		success: res => {
			if (res.confirm) {
				confirm(data)
			}
		}
	})
}

module.exports = {
	success,
	error,
	info,
	warn,
	choose
}